<script setup>
import { getSwiperApi } from '@/api/swiper';
import { onMounted, ref } from 'vue';
const images = ref([])
onMounted(
    async ()=>{
        const {state,msg, data:res} = await getSwiperApi()
        images.value=res;         
    }
)

</script>

<template>

    <van-swipe :autoplay="3000" lazy-render>
        <van-swipe-item v-for="image in images" :key="image">
            <img :src="image.poster" />
        </van-swipe-item>
    </van-swipe>

</template>

<style scoped lang="less">
.van-swipe{
    position: relative;
    z-index: 999;
}
   :deep(.van-swipe-item) {
        height: 210px !important;
        color: #fff;
        font-size: 20px;
        line-height: 150px;
        text-align: center;
        background-color: #39a9ed;
        img {
            object-fit: cover;
            height: 100%;
            width: 100%;
        }
    }

</style>